-
Notifications
You must be signed in to change notification settings - Fork 8.2k
build: expand ${ZEPHYR_<module>_MODULE_DIR} in CONF_FILE, OVERLAY_CONFIG #42057
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: expand ${ZEPHYR_<module>_MODULE_DIR} in CONF_FILE, OVERLAY_CONFIG #42057
Conversation
tejlmand
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this proposal.
I see the usefulness in it, but some general thoughts before going into implementation details.
To be consistent between specifying configuration files, then DTC_OVERLAY_FILE should also be updated to have similar behavior.
One concern with this approach is that it will be possible to use any CMake variable, for example -DCONF_FILE=<path>/${FOO}.conf.
If users start to depend on specific variables inside the build system being defined before the CONF_FILE is processed, then we will make it harder for ourselves to refactor our internals, cause suddenly some users might be depending on FOO being defined before CONF_FILE is used. FOO could even be an internal variable.
Of course, some variables could be considered safe, as they will most likely always be available before CONF_FILE is used.
For example: ZEPHYR_<name>_MODULE_DIR and BOARD.
As minimum it should be clearly documented what variables we officially support with this approach.
So please update the documentation to describe this new possibility, together with officially supported variables that can be used.
|
Thank you. Do you have a doc section in mind for this content? |
As general description, maybe adding it here:
For
with reference to variables that are officially supported with this method. For devicetree overlays, here: |
3c67d49 to
0f83faa
Compare
tejlmand
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating the docs.
Some comments, to ensure it become more precise.
0f83faa to
9ee4392
Compare
tejlmand
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update.
I took a look at the rendered output, and have a small proposal.
tests/cmake/overlays/var_expansions/my_extra_module/zephyr/my_extra_module-board.overlay
Outdated
Show resolved
Hide resolved
tests/cmake/overlays/var_expansions/my_module/zephyr/my_module-board.overlay
Outdated
Show resolved
Hide resolved
tejlmand
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks for this.
Found a stray the to be removed before merging, but approving as everything else is fine.
Support referencing module directories by name in CONF_FILE, OVERLAY_CONFIG, and DTC_OVERLAY_FILE so that projects can reference overlay files in arbitrary modules. Fixes zephyrproject-rtos#41830 Signed-off-by: Gregory Shue <[email protected]>
Adopted from review suggestions. Co-authored-by: Torsten Tejlmand Rasmussen <[email protected]>
baca450 to
99ff090
Compare
tejlmand
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - re-approved
|
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
|
@gregshue seems this has gone stale. |
|
@tejlmand I would still like this in, but I have not recognized any option to reopen the pull request. (I looked at https://github.community/t/re-opening-pull-request/1337/2 for guidance, but the "Reopen pull request" button shown next to "Comment" is not present in my view.) Guidance? |
|
@nashif, are you able to reopen this? The button is greyed out for me |
|
@nashif Are you able to reopen this? I'm not given the option. |
Support referencing module directories by name in CONF_FILE, and
OVERLAY_CONFIG so that projects can reference overlay files in arbitrary
modules.
Fixes #41830
Signed-off-by: Gregory Shue [email protected]